/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.front.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.front.entity.TestRecord;
import com.thinkgem.jeesite.modules.front.dao.TestRecordDao;

/**
 * 测试详细记录Service
 * @author 朱俊吉
 * @version 2017-11-30
 */
@Service
@Transactional(readOnly = true)
public class TestRecordService extends CrudService<TestRecordDao, TestRecord> {

	public TestRecord get(String id) {
		return super.get(id);
	}
	
	public List<TestRecord> findList(TestRecord testRecord) {
		return super.findList(testRecord);
	}
	
	public Page<TestRecord> findPage(Page<TestRecord> page, TestRecord testRecord) {
		return super.findPage(page, testRecord);
	}
	
	@Transactional(readOnly = false)
	public void save(TestRecord testRecord) {
		super.save(testRecord);
	}
	
	@Transactional(readOnly = false)
	public void delete(TestRecord testRecord) {
		super.delete(testRecord);
	}

	public TestRecord getByUserIdAndThemeId(TestRecord testRecord) {
		
		return dao.getByUserIdAndThemeId(testRecord);
	}

	/**
	 * 删除用户测试记录
	 * @param record
	 */
	@Transactional(readOnly = false)
	public void deleteRecordByUserAndType(TestRecord testRecord) {
		dao.deleteRecordByUserAndType(testRecord);
	}
	
}